{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Template Overview" %}</h3>
<div class="status row detail">
    <dl>
        <dt>{% trans "Name" %}</dt>
        <dd>{{ template.name }}</dd>
        <dt>{% trans "ID" %}</dt>
        <dd>{{ template.id }}</dd>
        <dt>{% trans "Description" %}</dt>
        <dd>{{ template.description|default:_("None") }}</dd>
    </dl>
    <dl>
        <dt>{% trans "Plugin" %}</dt>
        <dd><a href="{% url 'horizon:project:data_processing.data_plugins:details' template.plugin_name %}">{{ template.plugin_name }}</a></dd>
        <dt>{% trans "Version" %}</dt>
        <dd>{{ template.hadoop_version }}</dd>
    </dl>
    <dl>
        <dt>{% trans "Anti-affinity enabled for" %}</dt>
        {% if template.anti_affinity %}
            <dd>
                <ul class="list-bullet">
                {% for process in template.anti_affinity %}
                    <li>{{ process }}</li>
                {% endfor %}
                </ul>
            </dd>
        {% else %}
            <h6>{% trans "no processes" %}</h6>
        {% endif %}
    </dl>
    <dl>
    <dt>{% trans "Node Configurations" %}</dt>
        {% if template.cluster_configs %}
            <dd>
                {% for service, service_conf in template.cluster_configs.items %}
                    <h4>{{ service }}</h4>
                    {% if service_conf %}
                    <ul>
                    {% for conf_name, conf_value in service_conf.items %}
                        <li>{% blocktrans %}{{ conf_name }}: {{ conf_value }}{% endblocktrans %}</li>
                    {% endfor %}
                    </ul>
                    {% else %}
                    <h6>{% trans "No configurations" %}</h6>
                    {% endif %}
                {% endfor %}
            </dd>
        {% else %}
            <dd>{% trans "Cluster configurations are not specified" %}</dd>
        {% endif %}
    </dl>
</div>
